package com.campus.service.impl;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.transaction.Transactional;

import org.apache.struts2.ServletActionContext;
import org.springframework.stereotype.Service;

import com.campus.dao.UserDao;
import com.campus.entity.User;
import com.campus.service.UserSercvice;
import com.campus.util.SessionUtil;
@Service
@Transactional
public class UserSercviceImpl implements UserSercvice {

	@Resource
	private UserDao userDao;
	
	@Override
	public User getMyUser() {
		User user=(User)SessionUtil.getMyUserSession();
		return user;
	}

	@Override
	public List<User> selectList() {
		
		return userDao.selectList();
	}

	@Override
	public void add(User thisClass) {
		userDao.add(thisClass);
	}

	@Override
	public User getById(int id) {
		return userDao.getById(id);
	}

	@Override
	public void update(User thisClass) {
		userDao.update(thisClass);		
	}

	@Override
	public void deleteById(int id) {
		userDao.deleteById(id);
		
	}

	@Override
	public List<User> pagingList(int curPage, int pageCount) {
		
		return userDao.pagingList(curPage, pageCount);
	}

	@Override
	public int countAll() {
		return userDao.countAll();
	}

	@Override
	public List<User> checkName(String name) {
		return userDao.checkName(name);
	}

	@Override
	public List<User> checkLikeName(String name) {
		return userDao.checkLikeName(name);
	}

	
}
